package com.teamwhole.modules.grid.web;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.teamwhole.common.model.ResultInfo;
import com.teamwhole.modules.grid.entity.DailyCheck;
import com.teamwhole.modules.grid.service.DailyCheckService;

@Component
@Path("/gcb/dailyCheck")
@Consumes("application/json;charset=utf-8")
@Produces("application/json;charset=utf-8")
public class DailyCheckResource {
	
	@Autowired
	private DailyCheckService dailyCheckService;
	
	//在列表中显示所有数据
	@Path("/findList")
	@POST
	public List<DailyCheck> findByLoginName(DailyCheck model) {
		return dailyCheckService.findList(model);
	}
	
	//增加一条记录 
	@Path("/create")
	@POST
	public ResultInfo create(DailyCheck model) {
		dailyCheckService.save(model);
		return ResultInfo.ok();
	}
	

	// 更新
	@Path("/update")
	@POST
	public ResultInfo update(DailyCheck model) {
		dailyCheckService.save(model);
		return ResultInfo.ok();
	}

	// 删除
	@Path("/delete")
	@GET
	public ResultInfo delete(@QueryParam("id") String id) {
		dailyCheckService.delete(id);
		return ResultInfo.ok();
	}
}

